<%@page language="java" pageEncoding="UTF-8" contentType="text/html;charset=utf-8"%>
<%@include file="/includes/taglibs.jsp"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    
    <script type="text/javascript" src="<c:url value='/scripts/jquery/jquery.bgiframe-2.1.2.js'/>"></script>
    
    <script type="text/javascript">
    <!-- 
    $(document).ready(function() {
    	
         $('#addToUploadFileList').click(function(e){
         	var RowsNumber = $('#uploadFileList > tbody tr').length;
         	var attachment = $('#attachment').val();

         	//$('#uploadFileList > tbody:last').append("<tr>" + "<td>...</td>" + "<td>...</td>" + "<td><input type='button' value='刪除' onclick='deleteRow(this)' /></td></tr>");
         });
         
    }); 
    
    //-->
    </script>
</head>
<body>
	<div id="location">客戶交割款收付作業  / 交割款資料上傳</div>

<stripes:form id="uploadFileFrom" beanclass="com.feib.stps.action.Stms2001ActionBean" method="post" onsubmit="">	
	<div id="smallQueryForm"></div>
	
	<div id="queryForm">
		<table>
			<tr>
				<td colspan="4" class="queryHeader">交割款資料上傳</td>
			</tr>
			<tr>
				<th>上傳類別</th>
				<td colspan="4">交割款檔</td>
			</tr>
			<tr>
				<th>上傳檔案<span id="mustKeyInStar">**</span></th>
				<td>
					<stripes:file name="attachment" id="attachment" size="50"/> 
					<span class="queryFunction">
					<input type="button" id="addToUploadFileList" name="addToUploadFileList" value="加入上傳檔案清單" />
					</span>
				</td>
			</tr>
		</table>
	</div>
	
	<div id="listForm">
		<table id="uploadFileList">
			<thead>
			<tr>
				<td colspan="8" class="listHeader">上傳檔案清單 :</td>
			</tr>
			<tr>
				<th><input type="checkbox" id="checkAll" name="checkAll" /></th>
				<th>上傳類別</th>
				<th colspan="5">檔案名稱</th>
				<th>刪除</th>
			</tr>
			</thead>
			<tbody>
			</tbody>
			<c:forEach items="${actionBean.attachments}" var="attachment" varStatus="rowstat">
			<tr>
				<th><stripes:checkbox id="attachmentSelected[${rowstat.index}]" name="attachmentSelected[${rowstat.index}]" /></th>
				<td>驗資</td>
				<td colspan="5"><stripes:text id="attachments[${rowstat.index}]" name="attachments[${rowstat.index}]" value="<c:out value='${attachment}'/>"/></td>
				<td><input id="doDeleteAttachmentBtn" name="doDeleteAttachment" value="刪除" type="button" /></td>
			</tr>
			</c:forEach>
			<tfoot>
			<tr>
				<td colspan="8" class="listFunction"><stripes:submit id="doUpload" name="doUpload" value="上傳"/></td>
			</tr>
			</tfoot>
		</table>
	</div>
</stripes:form>
	
	<!-- Message -->
	<div id="ajaxErrorMessageDiv" style="display: none;"></div> 
     
</body>
</html>
